<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <link rel="shortcut icon" href="/images/a/logo.ico"/>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Welcome to Echo Blog</title>
    <style>
        /* 动画关键帧 */
        @keyframes float {
            0%, 100% {
                transform: translateY(0);
            }
            50% {
                transform: translateY(-10px); /* 向上移动10px */
            }
        }

        /* 应用动画 */
        .intro h1 {
            background:#060f85;
            font-size: 3rem;
            margin-bottom: 20px;
            font-weight: 600;
            color: #f7f7f8;
            animation: float 3s ease-in-out infinite; /* 3秒无限循环动画 */
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {

            font-family: 'Arial', sans-serif;
            overflow-x: hidden;
            height: 100%;
            /*background: linear-gradient(135deg, #f7b7a3, #ff9e8e);*/
            /*background-image: linear-gradient(120deg, #fdfbfb 0%, #ebedee 100%);*/
            background-image: linear-gradient(to top, #a8edea 20%, #fed6e3 80%);
            /* Warm gradient background */
            color: #333;
        }

        /* Fixed Progress Bar */
        .progress-bar {
            position: fixed;
            top: 0;
            left: 0;
            width: 0;
            height: 5px;
            background-color: #ff6f61;
            z-index: 9999;
            transition: width 0.1s ease;
        }

        /* Intro section */
        .intro {
            text-align: center;
            /*padding: 100px 20px;*/
            /*background: rgba(255, 255, 255, 0.85);*/
            /* Light translucent background */
            color: #333;
            height: 100vh;
            /*display: flex;*/
            /*flex-direction: column;*/
            /*justify-content: center;*/
            /*align-items: center;*/
            /*box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);*/
            /*background-image: linear-gradient(to top, #d5d4d0 0%, #d5d4d0 1%, #eeeeec 31%, #efeeec 75%, #e9e9e7 100%);*/
            background-image: url(/images/a/bg.jpg);
            margin: 0;
            padding: 0;
            position: relative;
            background-size: cover;
            background-repeat: no-repeat;
        }

        .container {
            background: rgba(36, 36, 156, 0.3);
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
        }

        .container p {
            font-size: 3rem;
            line-height: 3;
            /*color: #070707;*/
            /*font-size: 6em;*/
            color: rgba(23, 23, 23, 0.3);
            background-image: url(/images/a/water.png);
            text-transform: uppercase;
            letter-spacing: 6px;
            /* 注意添加私有前缀 */
            -webkit-background-clip: text;
            font-weight: 500;
            animation: wave 30s linear infinite;
        }

        @keyframes wave {
            from {
                background-position: 0 0;
            }
            to {
                background-position: 1000px 0;
            }
        }

        .intro h1 {
            font-size: 4rem;
            margin-bottom: 20px;
            font-weight: 600;
            /*color: #ff6f61;*/
            /*color: linear-gradient(to top, #a8edea 20%, #fed6e3 80%);*/
        }

        /*.intro p {*/
        /*    font-size: 1.25rem;*/
        /*    line-height: 1.6;*/
        /*    color: #555;*/
        /*}*/

        /* Features Section */
        .features {
            padding: 0;
        }

        .feature {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin: 0;
            opacity: 0;
            transform: translateY(100px);
            /* Hidden off-screen */
            transition: all 0.75s ease-in-out;
            height: 100vh;
            padding: 50px 20px;
        }

        .feature .image {
            width: 45%;
            border-radius: 15px;
            transform: translateX(-100px);
            /* Start from the left */
            transition: transform 0.75s ease-in-out;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        }

        .feature .image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 15px;
        }

        .feature .text {
            width: 45%;
            transform: translateX(100px);
            /* Start from the right */
            transition: transform 0.75s ease-in-out;
        }

        .feature h2 {
            font-size: 3rem;
            margin-bottom: 10px;
            font-weight: 500;
        }

        .feature p {
            font-size: 2rem;
            line-height: 1.6;
            color: #555;
        }

        /*!* Image Shape Variations *!*/
        /*.feature:nth-child(odd) .image img {*/
        /*    border-radius: 50%;*/
        /*    !* Circle for odd features *!*/
        /*}*/

        /*.feature:nth-child(even) .image img {*/
        /*    border-radius: 25px;*/
        /*    !* Rounded corners for even features *!*/
        /*}*/

        /* Enter button */
        .enter-btn {
            text-align: center;
            margin: 50px 0;
        }

        .enter-btn button {
            padding: 15px 30px;
            font-size: 18px;
            cursor: pointer;
            background-color: #ff6f61;
            color: white;
            border: none;
            border-radius: 25px;
            transition: background-color 0.3s;
        }

        .enter-btn button:hover {
            background-color: #e65c52;
        }

        .spacer {
            height: 100px;
        }
    </style>
</head>

<body>

<!-- Progress Bar -->
<div class="progress-bar"></div>

<section class="intro">
    <div class="container">
        <h1>Welcome to Echo Blog</h1>
        <p>下滑开启博客之旅!</p>
    </div>
</section>

<section class="features">
    <div class="feature" id="feature1">
        <div class="image">
            <img th:src="@{/images/a/logo.png}" alt="Feature 1">
        </div>
        <div class="text">
            <h2>Feature 1</h2>
<!--            <p>This is our website logo, which stands for unity as well as ECho!</p>-->
            <p>这是我们的博客logo,它代表着团队的凝聚力，也是Echo Blog的缩写!</p>
        </div>
    </div>
    <div class="feature" id="feature2">
        <div class="text">
            <h2>Feature 2</h2>
            <p>博客采用editor在线编辑器，更加灵活、美观；所见即所得!</p>
        </div>
        <div class="image">
            <img th:src="@{/images/a/b1.png}" alt="Feature 2">
        </div>
    </div>
    <div class="feature" id="feature3">
        <div class="image">
            <img th:src="@{/images/a/b2.png}" alt="Feature 3">
        </div>
        <div class="text">
            <h2>Feature 3</h2>
            <p>基于简洁的理念，评论区采用原生js编写</p>
        </div>
    </div>
    <div class="feature" id="feature4">
        <div class="text">
            <h2>Feature 4</h2>
            <p>基于Ace Editor可嵌入代码编辑器，实现本博客的在线java代码运行!</p>
        </div>
        <div class="image">
            <img th:src="@{/images/a/b3.png}" alt="Feature 4">
        </div>
    </div>
    <div class="feature" id="feature5">
        <div class="image">
            <img th:src="@{/images/a/b4.png}" alt="Feature 5">
        </div>
        <div class="text">
            <h2>Feature 5</h2>
            <p>博客实现收藏、下载md格式文本功能</p>
        </div>
    </div>
</section>

<div class="spacer"></div>

<div class="enter-btn">
    <button onclick="window.location.href='/blog/intoMain'">Enter System</button>
</div>

<script>
    // Update progress bar as the user scrolls
    window.addEventListener('scroll', function () {
        const scrollHeight = document.documentElement.scrollHeight - window.innerHeight;
        const scrollPosition = window.scrollY;
        const scrollProgress = (scrollPosition / scrollHeight) * 100;
        const progressBar = document.querySelector('.progress-bar');
        progressBar.style.width = scrollProgress + '%';

        // Animate features when they come into view
        const features = document.querySelectorAll('.feature');
        features.forEach(function (feature) {
            const rect = feature.getBoundingClientRect();
            const featureHeight = feature.offsetHeight;
            const windowHeight = window.innerHeight;

            // Only trigger animation when the element is in the center of the viewport
            if (rect.top <= (windowHeight / 2) && rect.bottom >= (windowHeight / 2)) {
                feature.style.opacity = '1';
                feature.querySelector('.image').style.transform = 'translateX(0)';
                feature.querySelector('.text').style.transform = 'translateX(0)';
            } else {
                feature.style.opacity = '0';
                feature.querySelector('.image').style.transform = 'translateX(-100px)';
                feature.querySelector('.text').style.transform = 'translateX(100px)';
            }
        });
    });
</script>

</body>

</html>